import request from '@/utils/request'

export function getAgents(params) {
  return request({
    url: `/agents`,
    params
  })
}

export function getAgentsCount(params) {
  return request({
    url: `/agents/count`,
    params
  })
}

export function delAgent(id) {
  return request({
    url: `/agents/${id}`,
    method: 'delete'
  })
}

export function addAgent(data) {
  return request({
    url: `/agents`,
    method: 'post',
    data
  })
}

export function getAgentDetail(id) {
  return request({
    url: `/agents/${id}`
  })
}

export function updateAgent(data) {
  return request({
    url: `/agents/${data.id}`,
    method: 'put',
    data
  })
}
